import serverApiMockUtils from '../utils/serverApiMockUtils'
import Mock from 'mockjs'
import SmsSendRecordResponse from '@/core/sms/types/model/response/SmsSendRecordResponse'
import SmsSupplierTypeEnum from '@/core/sms/enums/SmsSupplierTypeEnum'
import SmsSendRecordStatusEnum from '@/core/sms/enums/SmsSendRecordStatusEnum'
import { MockMethod } from 'vite-plugin-mock'
import mockProdServerUtils from '../utils/mockUtils'
import smsAdminApiConfig from '@/core/sms/generated/apiconfig/smsAdminApiConfig'

const content: SmsSendRecordResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		smsAppId: i.toString(),
		identifier: i.toString(),
		phoneNumber: `phoneNumber_短信发送记录_${i.toString()}`,
		content: `content_短信发送记录_${i.toString()}`,
		supplierType: SmsSupplierTypeEnum.getAll()[Mock.Random.integer(0, SmsSupplierTypeEnum.getAll().length - 1)].getCode(),
		status: SmsSendRecordStatusEnum.getAll()[Mock.Random.integer(0, SmsSendRecordStatusEnum.getAll().length - 1)].getCode(),
		resultRemark: `resultRemark_短信发送记录_${i.toString()}`,
		planSendTime: new Date().getTime().toString(),
		arrivalTime: new Date().getTime().toString(),
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as SmsSendRecordResponse)
}

const mockList = [...serverApiMockUtils.getDefaultServerApi(smsAdminApiConfig.smsSendRecord, content)] as MockMethod[]

mockProdServerUtils.addPriorityMockList(1, ...mockList)
